
// src/modules/dashboard/services.ts
import axios from 'axios';

export const fetchChartData = async () => {
    try {
        const response = await axios.get('/api/dashboard/chart-data');
        return response.data;  // 返回图表数据
    } catch (error) {
        throw new Error('获取图表数据失败');
    }
};

export const fetchStatsData = async () => {
    try {
        const response = await axios.get('/api/dashboard/stats');
        return response.data;  // 返回统计数据
    } catch (error) {
        throw new Error('获取统计数据失败');
    }
};
